import {createRouter, createWebHashHistory,} from 'vue-router'


const routes = [
    {
        path: '/',
        redirect: '/home',
        component: () => import('../views/Main.vue'),
        children: [


            {

                path: '/goodsinfo',
                component: () => import('../views/goodsinfo.vue')
            },

            {

                path: '/goodsinfoDetail',
                component: () => import('../views/goodsinfoDetail.vue')
            },
            {

                path: '/myorders',
                component: () => import('../views/users/myorders.vue')
            },
            {

                path: '/shopcart',
                component: () => import('../views/users/shopcart.vue')
            },

            {

                path: '/projectinfo',
                component: () => import('../views/projectinfo.vue')
            },

            {

                path: '/projectinfoDetail',
                component: () => import('../views/projectinfoDetail.vue')
            },
            {

                path: '/users/projectinfo',
                component: () => import('../views/users/projectinfo.vue')
            },
            {
                path: 'home',
                name: 'Home',
                component: () => import('../views/Home.vue')
            },
            {
                path: 'graph',
                name: 'Graph',
                component: () => import('../views/KnowledgeGraph.vue')
            },
            {
                path: 'heritage/list',
                name: 'HeritageList',
                component: () => import('../views/HeritageList.vue'),
            },
            {
                path: 'heritage/detail/:id',
                name: 'heritageDetail',
                component: () => import('../views/HeritageDetail.vue')
            },
            {
                path: 'user',
                name: 'User',
                component: () => import('../views/User.vue'),
                redirect: {name: "UserInfo"},
                children: [
                    {
                        path: '/info',
                        name: 'UserInfo',
                        component: () => import('../views/UserInfo.vue'),
                        meta: {
                            title: "个人信息"
                        }
                    },
                    {
                        path: '/favorite',
                        name: 'Favorite',
                        component: () => import('../views/Favorite.vue'),
                        meta: {
                            title: '收藏页'
                        }
                    }

                ]

            },


        ]
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
})

export default router